package com.foreknow.traning;

import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;

import java.util.Scanner;

public class Test {
    public void printBooksInfo(Book[] books){
        for (int i = 0;i < books.length;i++){
            Book book = books[i];//从数组中获取某一book对象
            System.out.println(book.getId() + "---" + book.getName() + "---" +book.getPrice() + "---" +book.getStorage());
        }

    }

    public void byBooks(Book[] books){
        Scanner input = new Scanner(System.in);
        for (int i = 0;i <3;i++){
            System.out.println("请输入图书的编号");
            int pid  = input.nextInt() ;
            System.out.println("请输入购买数量");
            int pum = input.nextInt();

        }
    }

    public void printOrderInfo(){

    }

    public static void main(String[] args) {
        Test test = new Test();
        Book[] books = new Book[3];
        Book book1 = new Book(1,"java",33.45,50);
        Book book2 = new Book(2,"SSM",44.45,100);
        Book book3 = new Book(3,"C",100,150);
        books[0] = book1;
        books[1] = book2;
        books[2] = book3;
        test.printBooksInfo(books);
    }

}
